//请求工具参考https://ext.dcloud.net.cn/plugin?id=392
const {
	http
} = uni.$u

//获取用户信息
export const createRoom = params => http.post('/jifenyuan/room/create', params)


//判断是否再房间内
export const checkRoom = params => http.post('/jifenyuan/room/checkRoom', {})


//离开房间
export const leaveCurrentRoom = params => http.post('/jifenyuan/room/leaveCurrentRoom', {})

//加入房间
export const joinPartnerRoom = params => http.get('/jifenyuan/room/joinPartnerRoom', {
	params
})

//观看房间
export const joinObserverRoom = params => http.get('/jifenyuan/room/joinObserverRoom', {
	params
})

//获取当前房间分享码
export const getRoomShareImg = params => http.post('/jifenyuan/room/getRoomShareImg', {})

//获取当前房间分享码
export const getRoomObserverImg = params => http.post('/jifenyuan/room/getRoomObserveImg', {})

//获取房间内成员
export const getRoomPartner = params => http.get('/jifenyuan/room/getRoomPartner', {})
//获取房间内成员分数
export const getRoomScore = params => http.get('/jifenyuan/room/getRoomScore', {})

//获取房间内成员
export const roomTransfer = params => http.post('/jifenyuan/room/roomTransfer', params)


//获取对战历史
export const historyRecord = params => http.get('/jifenyuan/room-user-bind/page', {
	params
})
//获取对战历史
export const getHistoryCount = params => http.get('/jifenyuan/room-user-bind/getCount', {
	params
})


//获取房间内积分列表
export const getRoomLogByRoomId = params => http.get('/jifenyuan/room-log/getRoomLogByRoomId', {
	params
})

//解散房间
export const closeRoom = params => http.get('/jifenyuan/room/closeRoom', {})
//获取历史对战房间
export const getRoomHistoryDetail = params => http.get('/jifenyuan/room-user-bind/getRoomHistoryDetail', {
	params
})

//获取当前创建的没有关闭的房间
export const getLeaderRoom = params => http.get('/jifenyuan/room/getLeaderRoom', {})

//隐藏自己
export const hideLeader = params => http.get('/jifenyuan/room/hideSelf', {})